When PHP submits a form determine the difference between if of $_POST[submit] and if of isset of $_POST[submit]

  • 2020-03-31 21:30:05
  • OfStack

If (isset($_POST['submit']) {
}
If ($_POST[submit]) versus if(isset($_POST[submit])) when submitting a form

The first method produces a warning, and the second is more rigorous.
Also, it's best to use single quotes for the key name of POST, which is slightly more efficient (3-4 times).
Well, that's pretty much what it means. If you set this variable, it returns true

What does if(isset($_POST['Submit'])) mean in PHP
Isset - detects whether a variable isset

Determine whether the data posted has been submitted

if(isset($_POST["submit"]){ 
echo " Here it is. "; 
}else 
{ 
echo "submit is no come~"; 
}

Related articles: